<template>
  <!-- <router-view v-slot="{ Component }">
    <keep-alive>
      <component
        :is="Component"
        :key="$route.name"
        v-if="$route.meta.keepAlive"
      />
    </keep-alive>
    <component
      :is="Component"
      :key="$route.name"
      v-if="!$route.meta.keepAlive"
    />
  </router-view> -->
  <router-view v-slot="{ Component }">
    <keep-alive :include="cacheRoutes">
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<script>
export default {
  name: "App",
  setup(){
    return {
      cacheRoutes:['page1']
    }
  },
  // mounted() {
  //   // console.log();
  // },
};
</script>
